@use '@scss/common' as *;

.wrapper {
  &.darkTheme {
    background: var(--color-base-950);

    & .backgroundGrid {
      z-index: 0;
    }
  }
}

.container {
  position: relative;
  align-items: center;
  row-gap: 3rem;

  @include mid-break {
    row-gap: 0;

    &.hasLinks {
      row-gap: 2rem;
    }
  }
}

.content {
  position: relative;
  z-index: 1;
}

.labelWrap {
  padding: 1rem 1rem 0;
}

.label {
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--color-base-700);
  color: var(--color-base-100);
  margin: 0;
}

.heading {
  margin-top: 0;
}

.richText {
  margin-bottom: 1.5rem;
}

.links {
  width: 100%;

  > * {
    width: 100%;
  }
}

.tabsWrapper {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 100%;
  border: 1px solid var(--theme-elevation-200);

  @include mid-break {
    position: relative;
  }
}

.parentCodeWrapper {
  align-items: unset;

  @include mid-break {
    margin: 0;
  }
}

.code {
  @include mid-break {
    overflow: unset;
  }
}

.tabs {
  position: relative;
  display: flex;
  gap: 2rem;
  padding: 0 2rem;
  background: var(--color-base-900);
  overflow-x: auto;
  scroll-behavior: smooth;
  @include dark-custom-scrollbar;

  &.hasMultiple {
    border-bottom: 1px solid var(--color-base-600);
  }

  @include mid-break {
    padding: 0 1rem;
  }
}

.hiddenTab {
  @include visually-hidden;
}

.tabIndicator {
  position: absolute;
  left: 0;
  height: 2px;
  width: 100%;
  bottom: 0px;
  background: var(--color-base-200);
  transition:
    width var(--trans-default) linear,
    left var(--trans-default) linear;
}

.tab {
  @include btnReset;
  cursor: pointer;
  padding: 1rem 0;
  @include body;
  color: var(--color-base-300);
  white-space: nowrap;

  &.isActive,
  &:hover {
    color: var(--color-base-50);
  }
}

.scanlineWrapper {
  position: relative;
  width: 100%;

  @include mid-break {
    display: none;
  }
}

.crosshairTopRight,
.crosshairBottomRight,
.crosshairTopLeft,
.crosshairBottomLeft {
  position: absolute;
  width: 1rem;
  height: auto;
  color: var(--theme-elevation-1000);
  opacity: 0.5;
}

.crosshairTopLeft {
  top: -0.5rem;
  left: -0.5rem;
}

.crosshairBottomLeft {
  bottom: -0.5rem;
  left: -0.5rem;
}

.crosshairTopRight {
  top: -0.5rem;
  right: -0.5rem;
}

.crosshairBottomRight {
  bottom: -0.5rem;
  right: -0.5rem;
}

.scanlineDesktopRight,
.scanlineDesktopLeft {
  width: calc(100% + var(--gutter-h) * 1);
}

.scanlineDesktopRight {
  margin-right: calc(var(--gutter-h) * -1);
}

.scanlineDesktopLeft {
  margin-left: calc(var(--gutter-h) * -1);
}

.scanlineMobile {
  display: none;

  @include mid-break {
    display: block;
    top: 50%;
    transform: translateY(-50%);
    height: calc(100% + 4px);
    width: calc(100% + var(--gutter-h) * 2);
    margin-left: calc(var(--gutter-h) * -1);
    margin-right: calc(var(--gutter-h) * -1);
  }
}

.codeBlockWrapper {
  position: relative;
  background-color: var(--color-base-900);
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
  overflow-x: auto;
  @include dark-custom-scrollbar;
}

.codeBlock {
  position: relative;
  display: block;
  visibility: hidden;
  grid-column: 1/1;
  grid-row: 1/1;

  &.isActive {
    visibility: visible;
  }
}
